﻿
using System.Windows;
using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.Messaging;
using Tp.Dto.Allgemein;
using Tp.Dto.Stammdaten;
using Tp.Interfaces.Commands.Stammdaten;

namespace Tp.StammdatenViewModel
{
	  public class PersonenViewModelCommands : IPersonenViewModelCommands
	  {

			#region Properties

			public RelayCommand<IAbstractDto> StartWorkingCommand { get; set; }
			public RelayCommand<PersonDto> SaveModelCommand { get; set; }
			public RelayCommand<string> SelectActionCommand { get; set; }

			#endregion

			#region C-Tor

            public PersonenViewModelCommands()
			{
				  this.RegisterCommands();
			}

			#endregion

			#region Private methods

			private void RegisterCommands()
			{
				  this.StartWorkingCommand = new RelayCommand<IAbstractDto>(ExecuteStartWorking);
				  this.SaveModelCommand = new RelayCommand<PersonDto>(ExecuteSaveModel);
				  this.SelectActionCommand = new RelayCommand<string>(ExecuteSelectAction);
			}

			#endregion

			#region Commands

			private void ExecuteStartWorking(IAbstractDto dtoObj)
			{
				  Messenger.Default.Send(dtoObj);
			}

			private void ExecuteSaveModel(PersonDto dtoObj)
			{
				  Messenger.Default.Send(dtoObj);
			}

			private void ExecuteSelectAction(string text)
			{
				  Messenger.Default.Send(text);
			}

			#endregion

	  }
}
